Copyright: Copyright © Robust Software


Contents

CodeLock For Windows 3.1

Sales & Information (800) 762-8780, (805) 688-6312

Overview of CodeLock

Implementing CodeLock

 --CodeLock Functions

About Robust Software

Disclaimer


Disclaimer

CodeLock for Windows 3.1, Copyright © 1994 by Robust Software, is provided as-is without warranty of any kind.  Robust Software shall not be liable for any loss of profits, loss of use, interruption of business, nor indirect, special, incidental or consequential damages of any kind from the use of this product.


CodeLock Functions
Contents

CodeLock For Windows 3.1

Sales & Information (800) 762-8780, (805) 688-6312

Overview of CodeLock

Implementing CodeLock

 --CodeLock Functions

--Program Lock Functions

--Time Lock Functions

--Counter Lock Functions

--Registration Functions

--Miscellaneous Functions

About Robust Software

Disclaimer


Registration Functions

 Registration Functions

 GenerateRegistrationID

 RegIDToProtCode

 WriteProductRegistration

 GetProductRegistration


Overview

Features

 Force users to register your products. No more hoping your registration card is returned!

 Protect your products from software piracy.

 Create demonstration products that are fully functional for a specified time or number of executions.

 Users can unlock a demonstration copy of your product by entering an unlock code, provided by you, removing all limitations of the program.

 Ship one version of your product and unlock separate modules based on the unlock code and the price you charge your customers.

 Control the number of users of your product in a LAN environment.

 NOT CUMBERSOME OR ANNOYING TO YOUR REAL CUSTOMERS.

Pricing:

License up to 250 total registered units $399 U.S.

License up to 1000 total registered units $699 U.S.

Unlimited usage licenses are available.

A registered unit is a product distributed with CodeLock that has been purchased and registered with your company. Shareware unregistered units are not counted in the total.

CodeLock is designed to help you, the software developer, protect your assets from software pirates!  We have tried to provide the same functionality as would be found in the most complete hardware "dongle" locks, only through software so as not to require your customers to tie up their parallel ports.  As with other types of copy protection schemes, using this package is no guarantee that your software will not be copied and used by software pirates.  It will, however, make the process much more difficult.

CodeLock has been designed to give you complete flexibility.  It merely provides the services whereby you can install the lock(s) you need, check them to see if they have been broken, or remove them.  If your copy protection lock has been broken, you have full control over what action is taken.  Registration database functions have also been added to the library, giving you the ability to save critical product information such as your user's name, company, product serial number, and other useful information (for your product's protection, this information is encrypted and stored in the lock database (see below) on the user's workstation.  You have the ability to retrieve and modify this data at any time).

How does CodeLock protect my application

Using a sophisticated algorithm, CodeLock is able to create a unique identifier for any workstation.  This identifier is guaranteed to not be the same on any two workstations.  CodeLock stores this unique identifier in a proprietary database which it creates on the workstation in which it is utilized when one of the Installation APIs is called.  The CheckLock APIs obtain the identifier for the system on which they are executed and compare it to the one stored in the database on that workstation.  If the database is non-existent or if the identifier is different, then the lock has been broken (meaning that your application was copied to a non-licensed workstation and executed).  Copying your application out onto the network, to tape, or to diskette, will not also copy the lock database.  In fact, the lock database cannot be copied to another system by any conventional means because it is hidden away on the workstation.  Thus, even if your application is copied to another workstation, unless that workstation has a valid license to run your application, the CheckLock APIs will fail. Even copying the lock database to another workstation will break the lock.

From within your installation program, you will need to call one of the CodeLock Installation APIs.  There are three types of lock Installation APIs, depending on the type of copy protection you need (more on this later).  After installation, your lock will be active.  To enforce the lock, within your application you will have to make periodic calls to the CheckLock APIs to insure that the lock is installed and is still valid.  If the lock becomes invalidated (broken), then the CheckLock APIs will return a failure code to indicate it.  From within your application, you can then choose any course of action you desire.

What kind of Locks are available

Three types of locks are available.  You may choose and combine the locks as you please.  Each lock is handled separately by CodeLock.  The three types of locks are:  the program lock, the time lock, and the counter lock.

The program lock is just basic copy protection and is installed using the InstallProgramLock API.  If your application is executed on a system which does not have a program lock installed, then the CheckProgramLock API will return a failure code.  Again, using the File Manager or DOS copy commands to copy your application to some other workstation will not be enough to allow the unlicensed workstation to execute your application.  When the application executes, your call to the CheckProgramLock API will fail because the workstation identifier for the unlicensed system will be different than the licensed system.  In addition, the lock database wouldn't have been copied to the unlicensed system in the first place since it cannot be retrieved using file copying commands. Even if the lock database is copied to another system, the lock will be broken.

The time lock has the same level of protection as the program lock. In fact, it uses the exact same technique and goes a step further.  That extra step is that when it is installed by your installation program or your application through the InstallTimeLock API, you specify a time limit that this lock will be valid in terms of days. For example, during installation, your install program could call the InstallTimeLock API and install a license for 10 days.  In addition to the user not being able to copy your application to another workstation and execute it, the CheckTimeLock API will return a failure code after the 10th day it was originally installed!  In addition, monitoring code has been added to see if the user is playing around with the clock.  The first sign of tampering will cause the time lock to be permanently broken. Here is how this is accomplished: each time your application makes a call to the CheckTimeLock API, it queries the system clock and compares the date and time with that which it has already stored away in the lock database.  If it finds the system's clock to be earlier than the last checked time in the lock database, it assumes that the user has set the clock back and immediately invalidates the time lock.  If, on the other hand, the system clock is later than the last checked time, it first insures that the lock has not expired and then stores the value of the system clock in the lock database as the last checked time.

Lastly, the counter lock also has the same level of protection as the program lock. In fact, it uses the same technique and goes a step further.  That extra step is that when it is installed by your installation program through the InstallCounterLock API, you specify a maximum count which will allow the lock to remain active until that count is decremented to zero.  For example, during installation, your install program could call the InstallCounterLock API and install a maximum counter license of 10 (the counter license might be enforced as program executions), so the application would only execute 10 times before the lock became invalidated.  The counter lock is enforced by your application after installation.  When your application starts, it first makes a call to the CheckCounterLock API to see if the lock is still valid.  If it is, then your application makes a call to InstallCounterLock with the ADD_COUNTER parameter which causes the maximum counter value stored in the lock database to decrement by one. When this counter value reaches zero, then subsequent calls to the CheckCounterLock API will return a failure code.


About Robust Software

Robust Software is the provider of quality applications and tools for professionals.

Other products from Robust Software:

Real Estate Partner:	Contact Management and reporting system for Real Estate Agents.

MLS Express	Multiple Listing service connection for Real Estate Partner and other Real Estate software..

Contact Partner:	Contact Management and reporting system for sales professionals.

Robust Software

2345 Janin Way

Solvang, CA 93463

Sales: (800) 762-8780

Fax: (805) 688-6193


Miscellaneous Functions

 Miscellaneous Functions

 GetVersionString

 IsCodeLockInstalled


Time Lock Functions

 Time Lock Functions

 InstallTimeLock

 CheckTimeLock

 RemoveTimeLock


Implementing CodeLock

This section is designed to get you up and running in as little time as possible, so the discussions are brief.  Sample source code demonstrating the techniques mentioned in this section can be found on the CodeLock installation diskette.  The sample programs have been well documented to help you understand how to make the most out of this library with as little effort as possible.

Six sets of APIs are defined, giving you complete access to the library.  The API sets are defined as follows:

Program lock functions

InstallProgramLock

CheckProgramLock

RemoveProgramLock

Time lock functions

InstallTimeLock

CheckTimeLock

RemoveTimeLock

Counter lock functions

InstallCounterLock

CheckCounterLock

RemoveCounterLock

Registration functions

GenerateRegistrationID

RegIDToProtCode

WriteProductRegistration

GetProductRegistration

Miscellaneous functions

GetVersionString

IsCodeLockInstalled

The program lock, time lock, and counter lock functions are very similar.  In essence, they install locks, check locks, and remove locks.  The InstallXXXLock functions are normally used in your installation program or the first time your application executes. The CheckXXXLock functions are normally used in various locations through-out your application to allow it to check whether a lock has been broken.  If a lock is broken, the return value from these functions will indicate failure.  The RemoveXXXLock functions are normally used by your uninstall process when you need to uninstall the product from the users system.

All of the lock functions require a product ID as a parameter.  This product ID is a unique 10 character alphanumeric identifier supplied by your application which is used by the library to identify your application's lock database. Thus, different applications may use the services of this library simultaneously so long as their product IDs are unique.

Program lock APIs

The program lock APIs protect your software from being copied and executed on other systems.  A program lock is established on the user's system during your products installation process.  Following installation, when your application is running, it should periodically check the integrity of the program lock by calling the CheckProgramLock function.  The return value of this function indicates whether or not the lock has been broken.  The following may cause a program lock to break:

The application is copied onto a different workstation.

If your application is copied by a user onto another workstation which was not licensed through a proper call to Code Lock's InstallProgramLock API, then as your application begins execution, it will get a failure code from the CheckXXXLock API.

The lock database has been tampered with.

The lock database is stored as a software copy protection file on a workstation's hard drive in C:\.  The files are stored with the read-only, system, and hidden attributes.  The names of the files are unique to each product ID.  If the file is modified or if its file attributes are changed in any way, then the lock for a particular application will fail.  NOTE:  the lock database software copy protection file is maintained on the root directly of a workstation's C: drive to allow your application to be copied to any other directory or drive which can be accessed by the workstation and still allow successful execution (if the user copies the files to a network volume, Code Lock will still be able to access the lock database for that application because it will maintain it in C:\.  Thus, this allows the workstation to maintain its lock regardless of where the application is stored (even a network volume), but the application will only work on a workstation who is licensed).

The application is installed improperly.

A program lock on a workstation is only valid if it was created using the InstallProgramLock function and if it has not been broken.  If an application is installed improperly due to neglect by the user to use your installation or setup program, then the user's workstation will not have a program lock and therefore, calls to CheckProgramLock will fail on that user's workstation.

Time lock APIs

The time lock APIs protect your software from being copied and executed on other systems.  A time lock is established on the user's system during your products installation process.  Following installation, your application should periodically check the integrity of the time lock by calling the CheckTimeLock function.  The return value of this function indicates whether the lock has been invalidated.   The following may cause a time lock to break:

All conditions as described by the program lock.

The time lock expired.

When the InstallTimeLock function is called, one of the parameters, nDaysTillExpire, indicates the number of days the lock will be active.  This means that CheckTimeLock will only return a failure code after nDaysTillExpire have elapsed.  Thus, on a ten day time lock, CheckTimeLock will return a failure code eleven days after it was installed.

Counter lock APIs

The counter lock APIs protect your software from being copied and executed on other systems.  A counter lock is established on the user's system during your products installation process.  Following installation, your application should periodically check the integrity of the counter lock by calling the CheckCounterLock function.  The return value of this function indicates whether the lock has been broken.  The following may cause a counter lock to break:

All conditions as described by the program lock.

The counter lock expired.

When the InstallCounterLock API is called, one of the parameters, wCount, indicates the maximum value of the counter.  This counter is then decremented by your application through calls to the InstallCounterLock API with the ADD_COUNTER parameter each time your application is executed.  The CheckCounterLock API will always return a failure code after this counter reaches zero.  Thus, an application installed with a maximum value of 10 for its counter will stop executing on the eleventh execution if it decrements the counter each time the application is executed and also checks to see if the counter lock valid through the CheckCounterLock API.

Code Lock and Networks

The lock database is stored as a software copy protection file on a workstation's hard drive in the root directory of drive C:.  The file is stored with the read-only, system, and hidden attributes.  The name of the file is based on the product ID.  If the file is modified or if its file attributes are changed in any way, then a call by your application to Code Lock's CheckLock APIs will return a failure code.  NOTE:  the lock database software copy protection file is maintained in the root directory of a workstation's C: drive.  This allows your application to be copied to any other directory or drive which can be accessed by the workstation without invalidating the lock.  This is because regardless of the directory in which the application is installed, the lock database will always remain in the root directory of drive C:.  This means that the user could copy your application onto a network volume and because the lock is implemented as a workstation lock/license, it would still only execute on those workstations that are licensed to run it.

Adding Code Lock to your Application

Code Lock is designed to work with any development environment capable of importing and making calls to DLL export functions.  The export function names have been hidden to make reverse engineering of the library more difficult.  Two files, CODELOCK.H and CODELOCK.BAS, are provided to be included in your C/C++ or Visual Basic Programs, respectively.  The purpose of these files is to define commonly used constants and definitions, as well as map the hidden export function names to more useful names.  In short, if you are using a development environment other than C/C++ or Visual Basic, you will need to create a mapping for the DLL export function names.  Please see the CODELOCK.H or CODELOCK.BAS files for more information.

C/C++ programs should include the CODELOCK.H file.  If the CODELOCK DLL is to be used, then the CODELOCK.LIB import file should be used for linking.

Visual Basic programs should include the CODELOCK.BAS file.

Using the registration functions

Here are a few examples of using the registration functions in CodeLock:

Scenario 1, Unlocking the program for a registered user.

This scenario is used to unlock a newly installed program after registering the product over the telephone or other communications medium.

1.	After installation of your program, the application should use the GenerateRegistrationID function to create a unique ID. Store this ID using the WriteProductRegistration function.

2.	Display a registration screen showing the registration ID and instructing the user to call your company with their registration ID in order to register the product and to receive the "unlock code".

3.	When the user calls, get their registration ID and use the Auth program supplied with CodeLock (or a program of your own that uses the RegIDToProtCode function) to generate the "unlock code".

4.	Your program should use the RegIDToProtCode function to validate the "unlock code" that the user enters.

5.	Store the unlock code using the WriteProductRegistration function.

6.	Perform whatever action you desire after successful registration. (i.e. install a program lock)

7.	Each time your program executes, check the status of the lock by using the CheckXXXLock functions.

NOTE:	If the user does not register the product, you can use the Counter Lock or Time Lock APIs to let them use it on a trial basis. Perfect for shareware applications!

Scenario 2, Unlocking program functionality, or execution time, based on the unlock code.

You can use CodeLock to unlock different parts of a program based on the unlock code given by you. This allows you to distribute one copy of your executable(s), and based on how much the customer pays (or other criteria you determine), you can unlock one or more modules of your program. You could also use this scenario to allow timed usage of your program in lease situations.

1.	Define some codes to specify levels of functionality, or timed usage, of your program.

Examples:

A1 = module 1.

A2 = module 1 and 2.

A3 = all modules.

T1 = 6 months usage.

T2 = 1 year usage.

ETC...

2.	Append the code to the registration ID when using the Auth program.

3.	Create and store the possible protection codes in your program using the RegIDToProtCode function.(i.e. RegIDToProtCode(regid+A1))

4.	Compare the unlock code input by the user to the protection codes generated in step 3 and determine what modules are to be unlocked or how long to create a Time Lock for.

5.	Store the unlock code using the WriteProductRegistration function.

6.	Each time your program executes, retrieve the unlock code using the GetProductRegistraion function, and determine what modules are to be unlocked and verify the state of the lock using the CheckXXXLock functions.


InstallTimeLock

C declaration:

int FAR PASCAL InstallTimeLock(lpszProductID, nDaysTillExpire)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

int nDaysTillExpire;	// Indicates the number of days the lock will be active.

Visual Basic declaration:

Function InstallTimeLock(lpszProductID As String, nDaysTillExpire As Integer)

Comments

The InstallTimeLock function installs a time lock for the product identified by lpszProductID.  The lock is active for the number of days indicated by nDaysTillExpire.

A time lock is designed to be used by applications which need to prevent execution or become crippled after a certain amount of time.  This lock is most often used in evaluation copies of software which act as full working versions for a period of time.

Returns

This function returns an integer whose value can be CODELOCK_SUCCESS on success, CODELOCK_FAILURE on failure.


Program Lock Functions

 Program Lock Functions

 InstallProgramLock

 CheckProgramLock

 RemoveProgramLock


InstallProgramLock

C declaration:

int FAR PASCAL InstallProgramLock(lpszProductID, lpszKey)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

LPSTR lpszKey;	// Points to a null terminated string containing the copy protection key.

Visual Basic declaration:

Function InstallProgramLock(lpszProductID As String, lpszKey As String)

Comments

The InstallProgramLock function installs a program lock for the calling application.  A program lock consists of a lock with a key.  The lpszProductID parameter identifies the lock and the lpszKey parameter is the key to the lock (the key will be needed by the CheckProgramLock API).  A program lock is used to copy protect an application so it cannot be copied to different systems.  A program lock file is created in the root directory of the C: drive with the following file attributes:  system, hidden, and read-only.

Returns

The return value is an integer whose value can be CODELOCK_SUCCESS on success, CODELOCK_FAILURE on failure.


CheckProgramLock

C declaration:

int FAR PASCAL CheckProgramLock(lpszProductID, lpszKey)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

LPSTR lpszKey;	// Points to a null terminated string containing the copy protection key.

Visual Basic declaration:

Function CheckProgramLock (lpszProductID As String, lpszKey As String)

Comments

The CheckProgramLock function checks the integrity of a program lock identified by lpszProductID and lpszKey.

The CheckProgramLock function should be used to check the integrity of a program lock.  If a program lock has been broken, i.e. the software was copied and is being run on a workstation other than the installed workstation, this function will return CODELOCK_FAILURE.

Returns

The return value is an integer whose value can be CODELOCK_SUCCESS if the program lock is valid or CODELOCK_FAILURE if the program lock is invalid.


RemoveProgramLock

C declaration:

int FAR PASCAL RemoveProgramLock(lpszProductID)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

Visual Basic declaration:

Function RemoveProgramLock(lpszProductID As String)

Comments

The RemoveProgramLock function removes the program lock for the product identified by lpszProductID.

Returns

The return value is an integer whose return value can be CODELOCK_SUCCESS on success, CODELOCK_FAILURE on failure.


CheckTimeLock

C declaration:

int FAR PASCAL CheckTimeLock(lpszProductID)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

Visual Basic declaration:

Function CheckTimeLock(lpszProductID As String)

Comments

The CheckTimeLock function checks to see if the time lock installed for lpszProductID has expired.

A time lock is designed to be used by applications which need to prevent execution or become crippled after a certain amount of time.  This lock is most often used in evaluation copies of software which act as full working versions for a period of time.

Returns

This function returns an integer whose value can be positive number indicating the number of days remaining in the time lock if the lock is valid or CODELOCK_FAILURE to indicate that either the time lock is invalid or has expired.


RemoveTimeLock

C declaration:

int FAR PASCAL RemoveTimeLock(lpszProductID)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

Visual Basic declaration:

Function RemoveTimeLock(ByVal lpszProductID As String)

Comments

The RemoveTimeLock function removes the time lock for the product identified by lpszProductID.

A time lock is designed to be used by applications which need to prevent execution or become crippled after a certain amount of time.  This lock is most often used in evaluation copies of software which act as full working versions for a period of time.

Returns

The return value is integer whose value is CODELOCK_SUCCESS on success, CODELOCK_FAILURE on failure.


Counter Lock Functions

 Counter Lock Functions

 InstallCounterLock

 CheckCounterLock

 RemoveCounterLock


InstallCounterLock

C declaration:

int FAR PASCAL InstallCounterLock(lpszProductID, nOperation, wCount)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

int nOperation;	// Indicates the operation to take. May be one of the following:

// SET_COUNTER	Sets the counter to the value in wCount.

// ADD_COUNTER	Increments the counter by the value in wCount.  If this value is negative, then the counter is decremented.

WORD wCount;	// Number of days for counter.

Visual Basic declaration:

Function InstallCounterLock(lpszProductID As String, nOperation As Integer, wCounts As Integer)

Comments

The InstallCounterLock function installs or decrements a counter lock for the product identified by lpszProductID by the value specified in wCount.  When the lock is installed, a usage count is established by the wCount parameter.  Successive calls to this function can be used to increment or decrement the counter lock.  When the counter lock reaches zero, the lock will expire.

A counter lock is designed to be used by applications which need to become crippled after a certain number of program executions.  This lock is most often used in evaluation copies of software which act as full working versions for a predetermined number of executions.

Returns

This function returns an integer whose value can be CODELOCK_SUCCESS on success, CODELOCK_FAILURE on failure.


CheckCounterLock

C declaration:

int FAR PASCAL CheckCounterLock(lpszProductID)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

Visual Basic declaration:

Function CheckCounterLock(lpszProductID As String) As Integer

Comments

The CheckCounterLock function checks to see if the counter lock installed for lpszProductID has expired.

A counter lock is designed to be used by applications which need to prevent execution or become crippled after a certain number of program executions.  This lock is most often used in evaluation copies of software which act as full working versions for a predetermined number of executions.

Returns

The return value is an integer whose value is a positive number indicating the number of executions remaining in the counter lock if the lock is valid or CODELOCK_FAILURE to indicate that either the counter lock is invalid or has expired.


RemoveCounterLock

C declaration:

int FAR PASCAL RemoveCounterLock(lpszProductID)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

Visual Basic declaration:

Function RemoveCounterLock(ByVal lpszProductID As String)

Comments

The RemoveCounterLock function removes the counter lock for the product identified by lpszProductID.

A counter lock is designed to be used by applications which need to prevent execution or become crippled after a certain number of program executions.  This lock is most often used in evaluation copies of software which act as full working versions for a predetermined number of executions.

Returns

The return value is an integer whose value can be CODELOCK_SUCCESS on success, CODELOCK_FAILURE on failure.


GenerateRegistrationID

C declaration:

int FAR PASCAL GenerateRegistrationID(lpszBuf, nBufSize, nMaxIDLen)

LPSTR lpszBuf;	// Points to a buffer area to receive the registration ID.

int nBufSize;	// Indicates the size of lpszBuf in bytes.

int nMaxIDLen;	// Indicates the maximum length of the registration ID generated.

Visual Basic declaration:

Function GenerateRegistrationID(lpsz As String, nCnt As Integer, nMaxIDLen As Integer)

Comments

The GenerateRegistrationID function generates a unique random registration ID which is no more than nMaxIDLen characters long consisting of alphanumeric characters.  The registration ID is stored in lpszBuf.

Returns

The return value is an integer whose value can be CODELOCK_SUCCESS on success, CODELOCK_FAILURE on failure.


RegIDToProtCode

C declaration:

WORD FAR PASCAL RegIDToProtCode(lpszRegID)

LPSTR lpszRegID;	// Points to a null terminated string containing the registration ID.

Visual Basic declaration:

Function RegIDToProtCode(lpsz As String)

Comments

The RegIDToProtCode function returns a WORD protection code for the lpszRegID passed. Use this function to generate a unique code from the registration string specified. This code can then be compared with a code you specify upon registration of the product.

Returns

The return value is a WORD whose value is a protection code.


WriteProductRegistration

C declaration:

int FAR PASCAL WriteProductRegistration(lpszProductID, lpszSerialNum, lpszRegID, lpszCompanyName, lpszUserName, lpszUserDef1, lpszUserDef2, lpszUserDef3)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

LPSTR lpszSerialNum;	// Points to a null terminated string containing a serial number.

LPSTR lpszRegID;	// Points to a null terminated string containing a registration ID.

LPSTR lpszCompanyName;	// Points to a null terminated string containing a company name.

LPSTR lpszUserName;	// Points to a null terminated string containing the user's name.

LPSTR lpszUserDef1;	// Points to a null terminated string containing a user defined string.

LPSTR lpszUserDef2;	// Points to a null terminated string containing a user defined string.

LPSTR lpszUserDef3;	// Points to a null terminated string containing a user defined string.

Visual Basic declaration:

Function WriteProductRegistration(lpszProductID As String, lpszSerialNum As String, lpszRegID As String, lpszCompanyName As String, lpszUserName As String, lpszUserDef1 As String, lpszUserDef2 As String, lpszUserDef3 As String)

Comments

Use this function to store encrypted information in the lock database for later retrieval.

Returns

The return value is CODELOCK_SUCCESS on success, and CODELOCK_FAILURE on failure.


GetProductRegistration

C declaration:

int FAR PASCAL GetProductRegistration(lpszProductID, lpszSerialNum, lpszRegID, lpszCompanyName, lpszUserName, lpszUserDef1, lpszUserDef2, lpszUserDef3)

LPSTR lpszProductID;	// Points to a null terminated string containing the product ID.

LPSTR lpszSerialNum;	// Points to a null terminated string containing a serial number.

LPSTR lpszRegID;	// Points to a null terminated string containing a registration ID.

LPSTR lpszCompanyName;	// Points to a null terminated string containing a company name.

LPSTR lpszUserName;	// Points to a null terminated string containing the user's name.

LPSTR lpszUserDef1;	// Points to a null terminated string containing a user defined string.

LPSTR lpszUserDef2;	// Points to a null terminated string containing a user defined string.

LPSTR lpszUserDef3;	// Points to a null terminated string containing a user defined string.

Visual Basic declaration:

Function GetProductRegistration(lpszProductID As String, lpszSerialNum As String, lpszRegID As String, lpszCompanyName As String, lpszUserName As String, lpszUserDef1 As String, lpszUserDef2 As String, lpszUserDef3 As String)

Comments

The GetProductRegistration API is designed to retrieve the product registration information for the product identified by lpszProductID.  The product registration information is stored in the lock database.

Returns

The return value is CODELOCK_SUCCESS on success, and CODELOCK_FAILURE on failure.


GetVersionString

C declaration:

VOID FAR PASCAL GetVersionString(lpszString, nSize)

LPSTR lpszModule;	// Points to a null terminated string to receive Code Lock version

int nSize;	// Maximum size of string

Visual Basic declaration:

Function GetVersionString(lpszVersion As String, size As Integer)

Comments

The GetVersionString function copies the current version string of the CodeLock library into the provided string, lpszString.


IsCodeLockInstalled

C declaration:

int FAR PASCAL IsCodeLockInstalled(lpszProductID)

LPSTR lpszProductID;	// Points to a null terminated string with the product ID.

Visual Basic declaration:

Function GetVersionString(lpszProductID As String)

Comments

This function checks to see if CodeLock has been installed on the system before.

Return

The return value is CODELOCK_SUCCESS if CodeLock has been installed before, CODELOCK_FAILURE if not.